#!/usr/bin/python

'''
sys.argv[1]: num
'''
import os, subprocess, time, sys

file = open('time', 'a')
startTime = time.time()
cmd = '/root/software/apache-cassandra-0.7.4-src/contrib/pig/bin/pig_cassandra_measure'
script = '/root/pigappscale/guestbook_countAuthor.pig'
p = subprocess.Popen([cmd, script])
p.wait()
endTime = time.time()
file.write('\n-------- ' + sys.argv[1] + '\n')
file.write('start time: ' + str(startTime) + '\n')
file.write('end time: ' + str(endTime) + '\n')
file.write('run time: ' + str(endTime-startTime) + '\n')
file.flush()
file.close()
